package com.citycloud.ccuap.tc.admin.entity;


import com.citycloud.ccuap.framework.service.Model;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mybatis.annotations.*;
import org.springframework.data.repository.query.parser.Part;

import java.util.Date;

import static org.springframework.data.mybatis.annotations.Id.GenerationType.UUID;

/**
 * 数据组实体对象
 * @author sufeng
 *
 */
@Data
@NoArgsConstructor
@Entity(table = "sys_datagroup")
public class SysDatagroup implements Model {
	private static final long serialVersionUID = 1L;

    @Id(strategy = UUID)
	@Column(name = "datagroup_id")
	private String datagroupId;

	@Column(name = "project_id")
	@Condition
	private Long projectId;

	@Column(name = "created_time")
	@Conditions({
			@Condition,
			@Condition(type = Part.Type.GREATER_THAN_EQUAL, properties="startCreatedTime"),
			@Condition(type = Part.Type.LESS_THAN, properties="endCreatedTime")
	})
	private Date createdTime;

	@Column(name = "updated_time")
	@Conditions({
			@Condition,
			@Condition(type = Part.Type.GREATER_THAN_EQUAL, properties="startUpdatedTime"),
			@Condition(type = Part.Type.LESS_THAN, properties="endUpdatedTime")
	})
	private Date updatedTime;

	@Column(name = "datagroup_code")
	@Condition(type = Part.Type.LIKE)
	private String datagroupCode;

	@Column(name = "datagroup_name")
	@Condition(type = Part.Type.LIKE)
	private String datagroupName;

	@Column(name = "datagroup_note")
	@Condition(type = Part.Type.LIKE)
	private String datagroupNote;

	@Column(name = "is_enable")
	@Condition
	private int isEnable;

	@Column(name = "is_deleted")
	private int isDeleted;

	@Column(name = "creator")
	@Condition(type = Part.Type.LIKE)
	private String creator;

	@Column(name = "updator")
	@Condition(type = Part.Type.LIKE)
	private String updator;

}